<template>
<div>
  <Header></Header>
  <Adv></Adv>
  <Menu :list="menuList"></Menu>
  <Guess :conten="guesList"></Guess>
</div>
</template>

<script>
  import Header from "./comp/Header"
  import Adv from "./comp/Adv"
  import Menu from "./comp/Menu"
  import axios from "axios"
  import Guess from "./comp/Guess"
    export default {
        name: "Index",
      components:{
          Header,
          Adv,
          Menu,
          Guess

      },
      mounted(){
          //前段页面发送请求给后端代码 访问api接口 后端代码访问数据库 数据库把数据后端 后端传给前段显示
          axios.get("/index.json").then(
            (resq) =>{
             const data=resq.data;
              this.menuList=data.menu;
              this.guesList=data.gue
              }
              );
      },
      data () {
        return {
          menuList:[],
          guesList:[]
        }
      }



    }
</script>

<style scoped>

</style>
